package org.hrqing.chess.config.props;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hrqing.chess.frame.ChessLabel;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * @author Hrqing
 */
@Getter
@Setter
@Configuration
@ConfigurationProperties(prefix = "system")
public class SystemConfigProps {

    @Getter
    public enum Depth {
        EASY("简单", 10),
        NORMAL("正常", 15),
        HARD("困难", 18),
        ;

        private final String simple;
        private final int depth;

        Depth(String simple, int depth) {
            this.simple = simple;
            this.depth = depth;
        }
    }

    @Getter
    @Setter
    @NoArgsConstructor
    @AllArgsConstructor
    public static class ChessConfigProperties {
        private ChessLabel.Color color = ChessLabel.Color.RED;
    }

    @Getter
    @Setter
    @NoArgsConstructor
    @AllArgsConstructor
    public static class AnimationConfigProperties {
        private boolean enable = true;
    }

    @Getter
    @Setter
    @NoArgsConstructor
    @AllArgsConstructor
    public static class DepthConfigProperties {
        private Depth depth = Depth.NORMAL;
    }

    private ChessConfigProperties chess = new ChessConfigProperties();
    private AnimationConfigProperties animation = new AnimationConfigProperties();
    private DepthConfigProperties depth = new DepthConfigProperties();
}
